import 'package:flutter/material.dart';

class StackCase extends StatelessWidget {
  const StackCase({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: 400,
      alignment: Alignment.center, //对齐方式
      decoration: const BoxDecoration(
        color: Colors.black12,
      ),
      child: Stack(
        alignment: Alignment.center, //子组件对齐方式（父组件没有设置对齐方式，会导致子组件的对齐方式影响到父组件）
        clipBehavior: Clip.none, //不裁切
        children: [
          Container(
            width: 200,
            height: 200,
            color: Colors.blue,
          ),
          //定位组件
          Positioned(
            top: -90,
            child: Image.asset(
              "assets/open_eyes.png",
              width: 100,
              height: 100,
            ),
          )
        ],
      ),
    );
  }
}
